package st.business.tepth.business.user.busnumber.workholder.maintain.work.content.standardwork.partrecord;

import java.util.List;

import io.reactivex.disposables.Disposable;
import st.business.tepth.base.OnDataConvertListener;
import st.business.tepth.business.bean.MaintainWorkDetailBean;
import st.business.tepth.business.bean.PartLocationBean;
import st.shadow.library.core.base.mvp.BaseModel;
import st.shadow.library.core.base.mvp.BasePresenter;
import st.shadow.library.core.base.mvp.BaseView;
/**
 * Author: shadow
 * Email:  1025431817@qq.com
 * Time:   2019-07-01 14:50
 */

public interface PartRecordContract {
    interface View extends BaseView {
        void showData(MaintainWorkDetailBean workDetailBean);
        void showError(String msg);
        void deleteProgram(int position);
        void showTempLocation(PartLocationBean partLocationBean, int position);
    }

    interface Model extends BaseModel {
        abstract Disposable getDetailData(String token, int maintenanceId,
                                          OnDataConvertListener<MaintainWorkDetailBean> success);
        Disposable postProgram(final String token, final int repairId,
                               final int repairTaskId, int maintainId,
                               String taskItemList,
                               OnDataConvertListener<MaintainWorkDetailBean>
                                       success);
        Disposable deleteProgram(String token, int repairId,
                                 int faultDiagnosticId, int planId,
                                 OnDataConvertListener<String>
                                         listener);
        Disposable addTempLocation(String token,
                                   String tempLocation,
                                   OnDataConvertListener<List<PartLocationBean>> listener);
    }

    abstract class  Presenter extends BasePresenter<View> {
        abstract void getDetailData(String token, int maintenanceId);
        abstract void confirmProgram(final String token, final int repairId,
                                     final int repairTaskId, int maintainId,
                                     String taskItemList);
        abstract void deleteProgram(String token, int repairId,
                                    int faultDiagnosticId, int planId,
                                    int position);

        abstract void addTempLocation(String token, int position,
                                      PartLocationBean partLocationBean,
                                      String tempLocation);
    }
}
